package TwoPoint;

/**
 * @description: 描述
 * @author: Mr.Hu
 * @create: 2022/3/22 10:48
 **/
public class RotateArrays {
    public static void main(String[] args) {
        int[] input = {1, 3, 5, 7};
        int k = 2;
        revese(input, 0, input.length-1);
        revese(input, 0, k - 1);
        revese(input, k , input.length-1);
        for (int x : input) {
            System.out.println(x);
        }
    }

    public static void revese(int[] nums, int start, int end) {
        int temp;
        while (start <= end) {
            temp = nums[start];
            nums[start] = nums[end];
            nums[end] = temp;
            start++;
            end--;
        }
    }
}
